import { defineStore } from 'pinia'
// 引入封装的接口
import request from '@/utils/sphRequest'
// import request1 from '@/utils/login-api'

import {user,register} from '@/api/moudle/user'
// 使用枚举定义接口
enum Api{
  useLogin = '/api/user/passport/login',
  usercode = '/api/user/passport/sendCode',
  registerUser = '/api/user/passport/register',
  loginout1='/api/user/passport/logout'
}

// 用户登录的接口
export const requserLogin=(userInfo:user)=>request.post(Api.useLogin,userInfo)
// 获取手机号验证码的接口
export const reqGetVerfyCode = (phone:any) => request.get(Api.usercode + `/${phone}`)
// 获取用户注册接口
// export const reqRegister=(user:user)=>request.post(Api.useLogin,userInfo)

export const reqRegister = (user: any) => request.post(Api.registerUser, user)
// 退出登录的接口
export const loginout=()=>request.get(Api.loginout1)